﻿@inject VersionedContentService VersionService

<!DOCTYPE html>
<html lang="en">
<head>
        <meta charset="utf-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover"/>
        <base href="@(HttpContext.Request.Headers["X-Forwarded-Prefix"].FirstOrDefault() ?? "/")"/>
        <link rel="stylesheet" href="@VersionService.GetVersionedPath("css/tailwind.css")"/>
        <link rel="stylesheet" href="@VersionService.GetVersionedPath("css/app.css")"/>
        <link rel="stylesheet" href="AliasVault.Admin.styles.css"/>
        <link rel="icon" type="image/png" href="favicon.png"/>
        <HeadOutlet @rendermode="RenderModeForPage"/>
    </head>

    <body class="bg-gray-50 dark:bg-gray-900" av-disable="true">
        <Routes @rendermode="RenderModeForPage"/>
        <script src="@VersionService.GetVersionedPath("lib/qrcode.min.js")"></script>
        <script src="@VersionService.GetVersionedPath("js/dark-mode.js")"></script>
        <script src="@VersionService.GetVersionedPath("js/utilities.js")"></script>
        <script src="_framework/blazor.web.js"></script>
    </body>
</html>

@code {
    [CascadingParameter] private HttpContext HttpContext { get; set; } = default!;

    private IComponentRenderMode? RenderModeForPage => HttpContext.Request.Path.StartsWithSegments("/user")
        ? null
        : InteractiveServer;
}
